package com.pms.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.pms.dao.OrganizationMapper;
import com.pms.pojo.Department;
import com.pms.service.OrganizationService;

@Service
public class OrganizationServiceImpl implements OrganizationService{

	@Autowired
	private OrganizationMapper organizationMapper;

	@Override
	public Department getDepartmentByDeptId(int deptId) {
		Department department = organizationMapper.getDepartmentByDeptId(deptId);
		return department;
	}

	@Override
	public List<Department> getDepartmentByDeptName(String deptName) {
		List<Department> departmentList = organizationMapper.getDepartmentByDeptName(deptName);
		return departmentList;
	}

	@Override
	public List<Department> getDepartmentByDeptType(Integer deptType) {
		List<Department> departmentList = organizationMapper.getDepartmentByDeptType(deptType);
		return departmentList;
	}

	@Override
	public List<Department> getDepartmentList() {
		List<Department> departmentList = organizationMapper.getDepartmentList();
		return departmentList;
	}

	@Override
	public void insertDepartment(Department department) {
		organizationMapper.insertDepartment(department);
		
	}

	@Override
	public void deleteDepartment(int deptId) {
		organizationMapper.deleteDepartment(deptId);
		
	}

	@Override
	public void updateDepartment(Department department) {
		organizationMapper.updateDepartment(department);
		
	}

	@Override
	public List<Department> getDepartmentListByCondition(Department department) {
		List<Department> departmentList = organizationMapper.getDepartmentListByCondition(department);
		return departmentList;
	}
	
	
}
